{% extends 'layout.html' %}


{% block content %}

    <h3>服务器列表</h3>
    <a href="{% url 'web:server_add' %}" class="btn btn-sm btn-primary"> 添加 </a>

    <table class="table table-hover">
        <thead>
        <tr>
            <th>序号</th>
            <th>ID</th>
            <th>主机名</th>
            <th>系统</th>
            <th>cpu物理个数</th>
            <th>跟新时间</th>
            <th>状态</th>
            <th>变更记录</th>
            <th>业务线</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>
        {% for server in all_servers %}
            <tr>
                <td>{{ forloop.counter }}</td>
                <td>{{ server.pk }}</td>
                <td><a href="{% url 'web:server_detail' server.pk %}">{{ server.hostname }}</a> </td>
                <td>{{ server.os_platform }}</td>
                <td>{{ server.cpu_physical_count }}</td>
                <td>{{ server.latest_date }}</td>
                <td>{{ server.get_device_status_id_display }}</td>
                <td><a href="{% url 'web:server_record' server.pk %}">查看</a> </td>
                <td>{{ server.business_unit }}</td>
                <td>
                    <a href="{% url 'web:server_edit' server.pk %}"> <i class="fa fa-edit"></i> </a>
                    <a href=""> <i class="fa fa-trash-o"></i> </a>
                </td>
            </tr>
        {% endfor %}

        </tbody>

    </table>
{% endblock %}